﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using PdfFileWriter;
//using System.Drawing;

//namespace ImageTagToolViewModel.Others
//{
//    /// <summary>
//    /// When printing must instantiate this class
//    /// </summary>
//    class PrintProvider
//    {
//        private PdfFont ArialNormal;
//        private double ImageHeight;
//        private bool Actors;
//        private bool Location;
//        private bool Date;
//        private bool Description;

//        /// <summary>
//        /// This method should be called when printing
//        /// </summary>
//        /// <param name="ImageId">picture ID, path</param>
//        /// <param name="Actors">display the names of the actors?</param>
//        /// <param name="Location">display the location?</param>
//        /// <param name="Date">display the date?</param>
//        /// <param name="Description">display the description?</param>
//        public void PrintImage(string ImageId, bool Actors, bool Location, bool Date, bool Description)
//        {
//            string TempFileName = "temp.pdf";
//            this.Actors = Actors;
//            this.Location = Location;
//            this.Date = Date;
//            this.Description = Description;
//            CreatePdfDocument(false, TempFileName, ImageId);
//            PrintHandler ph = new PrintHandler();
//            ph.SendToPrinter(TempFileName);
//        }

//        /// <summary>
//        /// function for PDF creation
//        /// </summary>
//        /// <param name="Debug">debug</param>
//        /// <param name="TempFileName">temporary file name</param>
//        /// <param name="ImageId">image ID, path</param>
//        private void CreatePdfDocument(Boolean Debug, String TempFileName, String ImageId)
//        {
//            PdfDocument Document = new PdfDocument(768, 1000, UnitOfMeasure.Point);
//            Document.Debug = Debug;
//            DefineFontResources(Document);
//            PdfPage Page = new PdfPage(Document);
//            PdfContents Contents = new PdfContents(Page);
//            DrawImage(Document, Contents, ImageId);
//            DrawText(Contents);
//            Document.CreateFile(TempFileName);

//            //Process Proc = new Process();
//            //Proc.StartInfo = new ProcessStartInfo(TempFileName);
//            //Proc.Start();

//            return;
//        }

//        /// <summary>
//        ///Define Font Resources 
//        /// </summary>
//        /// <param name="Document">PdfDocument object</param>
//        private void DefineFontResources(PdfDocument Document)
//        {
//            ArialNormal = new PdfFont(Document, "Arial", FontStyle.Regular, true);
//            return;
//        }

//        /// <summary>
//        ///Draw the text 
//        /// </summary>
//        /// <param name="Contents">PdfContents object</param>
//        private void DrawText(PdfContents Contents)
//        {
//            string Actors = "";
//            string Location = "";
//            string Date = "";
//            string Description = "";
//            string TheText = "";


//            // save graphics state
//            Contents.SaveGraphicsState();
//            Contents.Translate(1.1, 1.1);

//            //const Double Width = 700;
//            //const Double Height = 500;
//            const Double FontSize = 12.0;
//            //Contents.DrawText(0.0, ref PosY, 0.0, 0, 0.01, 0.05, false, Box);
//            Contents.DrawText(ArialNormal, FontSize, 20, 1000 - ImageHeight - 30, TheText);
//            Contents.RestoreGraphicsState();

//            //Lekérdezni a kép adatait
//            int i = 0;
//            if (this.Actors)
//            {
//                Actors = "Peti, Balázs, András";
//                TheText = "Actor(s): " + Actors;
//                Contents.DrawText(ArialNormal, FontSize, 20, 1000 - ImageHeight - 30 - i, TheText);
//                i += 20;
//            }
//            if (this.Location)
//            {
//                Location = "Miskolc";
//                TheText = "Location: " + Location;
//                Contents.DrawText(ArialNormal, FontSize, 20, 1000 - ImageHeight - 30 - i, TheText);
//                i += 20;
//            }
//            if (this.Date)
//            {
//                Date = "2012.12.20.";
//                TheText = "Date: " + Date;
//                Contents.DrawText(ArialNormal, FontSize, 20, 1000 - ImageHeight - 30 - i, TheText);
//                i += 20;
//            }
//            if (this.Description)
//            {
//                Description = "In front of the fountain.";
//                TheText = "Description: " + Description;
//                Contents.DrawText(ArialNormal, FontSize, 20, 1000 - ImageHeight - 30 - i, TheText);
//                i += 20;
//            }

//            return;
//        }

//        /// <summary>
//        /// this function draws a picture to the Pdf
//        /// </summary>
//        /// <param name="Document"></param>
//        /// <param name="Contents"></param>
//        /// <param name="ImageId"></param>
//        private void DrawImage(PdfDocument Document, PdfContents Contents, string ImageId)
//        {
//            //lekérdezni a kép helyét
//            String ImageLoc = ImageId;
//            // define local image resources
//            PdfImage Image1 = new PdfImage(Document, ImageLoc);

//            Image1.SetImageQuality(100);

//            SizeD ImageSize = Image1.ImageSizeAndDensity(750, 900, 0.0);

//            // save graphics state
//            Contents.SaveGraphicsState();

//            // draw image
//            Contents.DrawImage(Image1, 768 / 2 - ImageSize.Width / 2, 1000 - ImageSize.Height - 10,
//                ImageSize.Width, ImageSize.Height);
//            ImageHeight = ImageSize.Height;
//            // restore graphics state
//            Contents.RestoreGraphicsState();
//            return;
//        }
//    }
//}

